package cn.iocoder.yudao.module.pi.controller.admin.pipline.task.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class TaskCreateReqVO {

    @JsonProperty("deployType")
    private String deployType;
    @JsonProperty("env")
    private String env;
    @JsonProperty("id")
    private String id;
    @JsonProperty("pipeline_id")
    private String pipelineId;
    @JsonProperty("manifest_version")
    private String manifestVersion;
    @JsonProperty("name")
    private String name;
    @JsonProperty("description")
    private String description;
    @JsonProperty("is_publish")
    private Boolean isPublish;
    @JsonProperty("executor_id")
    private String executorId;
    @JsonProperty("executor_name")
    private String executorName;
    @JsonProperty("executor_user_name")
    private String executorUserName;
    @JsonProperty("status")
    private String status;
    @JsonProperty("trigger_type")
    private String triggerType;
    @JsonProperty("run_number")
    private Integer runNumber;
    @JsonProperty("start_time")
    private Long startTime;
    @JsonProperty("end_time")
    private Object endTime;
    @JsonProperty("current_system_time")
    private Long currentSystemTime;
    @JsonProperty("stages")
    private List<StagesDTO> stages;
    @JsonProperty("domain_id")
    private String domainId;
    @JsonProperty("project_id")
    private String projectId;
    @JsonProperty("region")
    private String region;
    @JsonProperty("component_id")
    private String componentId;
    @JsonProperty("language")
    private String language;
    @JsonProperty("sources")
    private List<?> sources;
    @JsonProperty("artifacts")
    private Object artifacts;
    @JsonProperty("group_id")
    private String groupId;
    @JsonProperty("group_name")
    private String groupName;
    @JsonProperty("subject_id")
    private String subjectId;

    @NoArgsConstructor
    @Data
    public static class StagesDTO {
        @JsonProperty("id")
        private String id;
        @JsonProperty("category")
        private Object category;
        @JsonProperty("name")
        private String name;
        @JsonProperty("identifier")
        private String identifier;
        @JsonProperty("run_always")
        private Boolean runAlways;
        @JsonProperty("parallel")
        private Object parallel;
        @JsonProperty("is_select")
        private Boolean isSelect;
        @JsonProperty("sequence")
        private Integer sequence;
        @JsonProperty("depends_on")
        private List<?> dependsOn;
        @JsonProperty("condition")
        private Object condition;
        @JsonProperty("status")
        private String status;
        @JsonProperty("start_time")
        private Long startTime;
        @JsonProperty("end_time")
        private Object endTime;
        @JsonProperty("pre")
        private List<PreDTO> pre;
        @JsonProperty("post")
        private List<?> post;
        @JsonProperty("jobs")
        private List<JobsDTO> jobs;

        @NoArgsConstructor
        @Data
        public static class PreDTO {
            @JsonProperty("runtime_attribution")
            private Object runtimeAttribution;
            @JsonProperty("multi_step_editable")
            private Integer multiStepEditable;
            @JsonProperty("official_task_version")
            private Object officialTaskVersion;
            @JsonProperty("icon_url")
            private Object iconUrl;
            @JsonProperty("name")
            private String name;
            @JsonProperty("task")
            private String task;
            @JsonProperty("business_type")
            private Object businessType;
            @JsonProperty("inputs")
            private Object inputs;
            @JsonProperty("env")
            private Object env;
            @JsonProperty("sequence")
            private Integer sequence;
            @JsonProperty("identifier")
            private Object identifier;
            @JsonProperty("endpoint_ids")
            private Object endpointIds;
            @JsonProperty("id")
            private String id;
            @JsonProperty("last_dispatch_id")
            private String lastDispatchId;
            @JsonProperty("status")
            private String status;
            @JsonProperty("message")
            private Object message;
            @JsonProperty("start_time")
            private Long startTime;
            @JsonProperty("end_time")
            private Long endTime;
            @JsonProperty("daily_build_number")
            private Object dailyBuildNumber;
        }

        @NoArgsConstructor
        @Data
        public static class JobsDTO {
            @JsonProperty("id")
            private String id;
            @JsonProperty("category")
            private Object category;
            @JsonProperty("sequence")
            private Integer sequence;
            @JsonProperty("async")
            private Object async;
            @JsonProperty("name")
            private String name;
            @JsonProperty("identifier")
            private String identifier;
            @JsonProperty("depends_on")
            private List<?> dependsOn;
            @JsonProperty("condition")
            private String condition;
            @JsonProperty("resource")
            private String resource;
            @JsonProperty("is_select")
            private Boolean isSelect;
            @JsonProperty("timeout")
            private String timeout;
            @JsonProperty("last_dispatch_id")
            private String lastDispatchId;
            @JsonProperty("execute_cost_time")
            private Integer executeCostTime;
            @JsonProperty("status")
            private String status;
            @JsonProperty("message")
            private Object message;
            @JsonProperty("start_time")
            private Long startTime;
            @JsonProperty("end_time")
            private Object endTime;
            @JsonProperty("exec_id")
            private String execId;
            @JsonProperty("steps")
            private List<StepsDTO> steps;

            @NoArgsConstructor
            @Data
            public static class StepsDTO {
                @JsonProperty("runtime_attribution")
                private Object runtimeAttribution;
                @JsonProperty("multi_step_editable")
                private Integer multiStepEditable;
                @JsonProperty("official_task_version")
                private Object officialTaskVersion;
                @JsonProperty("icon_url")
                private Object iconUrl;
                @JsonProperty("name")
                private String name;
                @JsonProperty("task")
                private String task;
                @JsonProperty("business_type")
                private String businessType;
                @JsonProperty("inputs")
                private List<InputsDTO> inputs;
                @JsonProperty("env")
                private Object env;
                @JsonProperty("sequence")
                private Integer sequence;
                @JsonProperty("identifier")
                private Object identifier;
                @JsonProperty("endpoint_ids")
                private List<?> endpointIds;
                @JsonProperty("id")
                private String id;
                @JsonProperty("last_dispatch_id")
                private String lastDispatchId;
                @JsonProperty("status")
                private String status;
                @JsonProperty("message")
                private Object message;
                @JsonProperty("start_time")
                private Long startTime;
                @JsonProperty("end_time")
                private Object endTime;
                @JsonProperty("daily_build_number")
                private Object dailyBuildNumber;

                @NoArgsConstructor
                @Data
                public static class InputsDTO {
                    @JsonProperty("key")
                    private String key;
                    @JsonProperty("value")
                    private String value;
                }
            }
        }
    }
}
